package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Spadescriptionlist;
import com.ean.backpack.repository.SpadescriptionlistRepository;
import com.ean.backpack.service.SpadescriptionlistService;

@Service
@Transactional
public class SpadescriptionlistServiceImpl implements SpadescriptionlistService {

	@Autowired
	SpadescriptionlistRepository spadescriptionlistRepository;

	public long countAllSpadescriptionlists() {
		return spadescriptionlistRepository.count();
	}

	public void deleteSpadescriptionlist(Spadescriptionlist spadescriptionlist) {
		spadescriptionlistRepository.delete(spadescriptionlist);
	}

	public Spadescriptionlist findSpadescriptionlist(Integer id) {
		return spadescriptionlistRepository.findOne(id);
	}

	public List<Spadescriptionlist> findAllSpadescriptionlists() {
		return spadescriptionlistRepository.findAll();
	}

	public List<Spadescriptionlist> findSpadescriptionlistEntries(
			int firstResult, int maxResults) {
		return spadescriptionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveSpadescriptionlist(Spadescriptionlist spadescriptionlist) {
		spadescriptionlistRepository.save(spadescriptionlist);
	}

	public Spadescriptionlist updateSpadescriptionlist(
			Spadescriptionlist spadescriptionlist) {
		return spadescriptionlistRepository.save(spadescriptionlist);
	}
}
